package com.hj.testdb.database.updatedatabase;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

import com.hj.testdb.database.DaoMaster;
import com.hj.testdb.database.UserDao;

//使用方法 Helper helper = new Helper(this, "greedDaoDemo.db", null);
public class MyDatabaseHelper extends DaoMaster.OpenHelper {


    public MyDatabaseHelper(Context context, String name) {
        super(context, name);
    }

    public MyDatabaseHelper(Context context, String name, SQLiteDatabase.CursorFactory factory) {
        super(context, name, factory);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        if (oldVersion < newVersion) {
            MigrationHelper.migrate(db, UserDao.class);
        }
    }
}
